﻿@model Physis.Client.Models.Insurer.InsurerModel

@{ Layout = "~/Views/ApplicationMaster.cshtml"; }

@* TITLE BAR IS MOVED TO TOP BY JAVASCRIPT, SINCE WE ARE USING THE STANDARD MASTER *@

<div id="EntityTitleBar" class="ui-state-default">

    <table style="width: 100%;">
            
        <tr class="" style="height: 32px;">

            <td style="padding-left: .125in;width: 100%;"><b>Insurer: <label id="InsurerNameLabel">@Model.Insurer.Name</label></b></td>

            <td>

                <select onchange="UpdateTheme($(this).val());">

                    <option value="Blitzer">Blitzer</option>

                    <option value="Cupertino">Cupertino</option>

                    <option value="Darkness">Darkness</option>

                    <option value="Eggplant">Eggplant</option>

                    <option value="Humanity">Humanity</option>

                    <option value="Lightness">Lightness</option>

                    <option value="Overcast">Overcast</option>

                    <option value="Redmond">Redmond</option>

                    <option value="Smoothness">Smoothness</option>

                    <option value="Start">Start</option>

                    <option value="Sunny">Sunny</option>

                </select>

            </td>
                
        </tr>

    </table>

</div>

<form id="CoreObjectItemForm" style="margin: 0px; padding: 0px;">


@Html.HiddenFor(model => model.Insurer.Id)

    <div style="margin: 0px 0px 10px 0px; padding: 4px; line-height: 150%;">
                    
        <div style="padding: 4px;">

            <table style="border-collapse:separate; border-spacing: 5px;" > 

                <thead><tr>

                    <th style="width: 80px;"></th>

                    <th></th>
                    
                </tr></thead>

                <tbody>
                    
                    <tr>

                        <td><span id="Insurer_Name_Label" style="font-weight: bold;">Name:</span></td>

                        <td>

                            @if (Model.Insurer.Id != 0) { 

                            <div id="Insurer_Name_Read" style="min-height: 24px;">@Model.Insurer.Name <a href="javascript:void(0);" onclick="$(this).closest ('div').parent().children().toggle();">(edit)</a></div>
                                
                            }

                            <div id="Insurer_Name_Edit" style="min-height: 24px; display: @((Model.Insurer.Id != 0) ? "none;" : "block;")"> 
                                
                                @Html.TextBoxFor(model => model.Insurer.Name, new { style="width: 250px;", onchange="Name_OnChange(this);" })

                                @if (Model.Insurer.Id != 0) { 

                                <a href="#"  >(save)</a>

                                <a href="#" href="javascript:void(0);" onclick="$(this).closest ('div').parent().children().toggle();">(cancel)</a>
                                    
                                }

                            </div>

                        </td>

                    </tr>

                    <tr>

                        <td style="font-weight: bold;">Insurer Type:</td>

                        <td>

                            @if (Model.Insurer.Id !=0) { 
                                
                                <span>@Physis.Data.Functions.PascalString(Model.Insurer.InsurerType.ToString())</span>

                            }

                            else {
                                
                                <select id="Insurer_InsurerType" name="Insurer.InsurerType">

                                    <option value="0">Internal</option>

                                    <option value="1">Coordination of Benefits</option>

                                    <option value="2">Third Party Liability</option>

                                </select>

                            }

                        </td>

                    </tr>
              
                </tbody>

            </table>            

        </div>
                        
    </div>

    <div class="TextNormal" style="padding: 8px; height: 470px;">
        
        <div class="ui-state-active" style="padding: 4px;">Identifiers</div>

        <div class="ui-widget-content" style="margin: 0px 0px 10px 0px; padding: 4px; line-height: 150%; border-top-width: 0px;">

            <table style="border-collapse:separate; border-spacing: 5px;" > 

                <thead><tr>

                    <th style="width: 100px;"></th>

                    <th style="width: 100px;"></th>

                    <th></th>

                    <th style="width: 100px;"></th>

                    <th style="width: 100px;"></th>

                    <th></th>

                </tr></thead>

                <tbody>

                    <tr>

                        <td style="font-weight: bold;">National Plan Id:</td>

                        <td>@Html.TextBoxFor(model => model.Insurer.NationalPlanId, new { style="width: 100px;", maxlength="20" })</td>

                        <td><div class="ui-state-default ui-corner-all" style="width: 16px; cursor: help;" title="HIPAA Identifier"><span class="ui-icon ui-icon-help"></span></div></td>

                        <td style="font-weight: bold;">Federal Tax Id:</td>

                        <td>@Html.TextBoxFor(model => model.Insurer.FederalTaxId, new { style="width: 100px;", maxlength="9" })</td>

                        <td><div class="ui-state-default ui-corner-all" style="width: 16px; display: none;"><span class="ui-icon ui-icon-help"></span></div></td>

                    </tr>
                    
                    <tr>

                        <td style="font-weight: bold;">Unique Id:</td>

                        <td>@Html.TextBoxFor(model => model.Insurer.UniqueId, new { style="width: 100px;", maxlength="20" })</td>

                        <td><div class="ui-state-default ui-corner-all" style="width: 16px; cursor: help;" title="(optional) Unique Business Identifier for the Plan. If missing, will automatically be set to the Id of the Entity."><span class="ui-icon ui-icon-help"></span></div></td>

                        <td style="font-weight: bold;">Legacy Id:</td>

                        <td>@Html.TextBoxFor(model => model.Insurer.LegacyId, new { style="width: 100px;", maxlength="20" })</td>

                        <td><div class="ui-state-default ui-corner-all" style="width: 16px; cursor: help;" title="(optional) Unique Identifier of the Entity in the original Legacy System. Can be used for mapping data between systems."><span class="ui-icon ui-icon-help"></span></div></td>

                    </tr>

                </tbody>

            </table>

        </div>

        <div class="ui-state-active" style="padding: 4px;">Addresses</div>
        
        <div class="ui-widget-content" style="margin: 0px 0px 10px 0px; padding: 4px; line-height: 150%; border-top-width: 0px;">

            <p>Reserved for future use.</p>

        </div>

    </div>
        
    <div id="ButtonContainer" class="ui-widget-content" style="margin: 0px; padding: 0px; border-width: 1px 0px 0px 0px;"><div style="padding: 6px;">

        <table style="width: 100%;" border="0"><tr>
    
            <td style="padding-left: .125in; white-space: nowrap; width: 85px; font-weight: bold;">Last Response:</td>

            <td style="padding-left: .125in;"><label id="LastResponseMessageLabel"></label></td>
    
            <td style="width: .125in;">&nbsp;<input id="ButtonClicked" name="ButtonClicked" type="hidden" value="" /></td>

            <td style="padding-right: .125in; width: 45px;">

                <div id="AjaxWorking" style="display: none;">

                    <div>Working</div>
                
                    <div id="AjaxWorking_ProgressBar" style="width: 45px;"></div>                    

                </div>

            </td>

            <td style="width: 80px;"><button id="ButtonOK" type="button" style="width: 75px; height: 24px; font-size: 8pt; padding: 0px;" onclick="OkApply_OnClick (this);" value="OK">OK</button></td>    
    
            <td style="width: .125in;">&nbsp;</td>

            <td style="width: 80px;"><button id="ButtonCancel" type="button" style="width: 75px; height: 24px; font-size: 8pt; padding: 0px;" onclick="Cancel_OnClick (this);" value="Cancel">Cancel</button></td>    
        
            <td style="width: .125in;">&nbsp;</td>

            <td style="width: 80px;"><button id="ButtonApply" type="button" style="width: 75px; height: 24px; font-size: 8pt; padding: 0px;" onclick="OkApply_OnClick (this);" value="Apply">Apply</button></td>    

        </tr></table>

    </div></div>

</form>

<script type="text/javascript" src="~/Scripts/Application/Insurer/Insurer.js"></script>
